import request from '@/utils/request'

const api_name = '/admin/system/sysUser'

export default {
    //获取角色分页列表
    getPageList(pageNum, pageSize, searchObj) {
        return request({
            url: `${api_name}/${pageNum}/${pageSize}`,
            method: 'get',
            params: searchObj // url查询字符串或表单键值对
        })
    },
    //获取角色
    getById(id) {
        return request({
            url: `${api_name}/get/${id}`,
            method: 'get'
        })
    },
    //添加用户
    save(user) {
        return request({
            url: `${api_name}/save`,
            method: 'post',
            data: user
        })
    },
    //更新用户
    updateById(user) {
        return request({
            url: `${api_name}/update`,
            method: 'put',
            data: user
        })
    },
    //删除用户
    removeById(id) {
        return request({
            url: `${api_name}/remove/${id}`,
            method: 'delete'
        })
    },
    //修改状态
    updateStatus(id, status) {
        return request({
          url: `${api_name}/updateStatus/${id}/${status}`,
          method: 'get'
        })
    }

}